﻿using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Table;
using POC.Azure.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace POC.Azure.Storage
{
    
    public interface ICloudStorageRespository
    {
        Task PutEntry(LogEntry entry, bool lazyExecute);
        void InitializeRepository();
    }
    
    public interface IStorageRespository<T>
    {
        void InitializeRepository();
    }
    public interface ITableStorageRespository<T> : IStorageRespository<T>
    {
        Task AddEntry(T entry, bool lazyExecute);
        List<ITableEntity> GetEntries(TableQuery rangeQuery);
        ITableEntity GetEntry(TableQuery rangeQuery);
        Task UpdateEntry(T t, bool lazyExecute = false);
        Task DeleteEntry(T t, bool lazyExecute = false);
        Task PutEntry(T t, bool lazyExecute = false);
        List<T> GetAllEntries(string[] columnsName = null);
        IEnumerable<T> Get(string tableName, string partitionKey, IEnumerable<string> rowKeys);
    }
    public interface IQueueStorageRespository<T> : IStorageRespository<T>
    {
        void WriteFromStream(Stream stream, string name);
        void ReadToStream(Stream stream, string name);
        IEnumerable<IListBlobItem> ListBlobs(string prefix);
        bool Delete(string uri);
    }  
    public interface IBlobStorageRespository<T> : IStorageRespository<T>
    {
        void WriteFromStream(Stream stream, string name);
        void ReadToStream(Stream stream, string name);
        IEnumerable<IListBlobItem> ListBlobs(string prefix);
        bool Delete(string uri);
    }  
}
